using System.Collections.ObjectModel;
using Avalonia.Media;
using AvaloniaWeChatList.Models;
using CommunityToolkit.Mvvm.ComponentModel;

namespace AvaloniaWeChatList.ViewModels;

public partial class ChatContentItemModel : ViewModelBase
{
    [ObservableProperty] private IImage? _path;

    [ObservableProperty] private string? _title;

    [ObservableProperty] private ChatItemModel? _chatItemModel;

    [ObservableProperty] private ObservableCollection<MessagesItem> _messages = [];

    public void Enter()
    {
        Title = ChatItemModel.Name;
    }
}

public sealed partial class MessagesItem : ViewModelBase
{
    [ObservableProperty] private IImage _photo = null!;

    [ObservableProperty] private string _content = null!;

    [ObservableProperty] private string _name = null!;

    [ObservableProperty] private bool _isSelf;
}